1. Field of the Invention
The present invention relates to an image processing apparatus and method for encoding and decoding an input binary image.
2. Related Background Art
Hitherto, various image encoding systems have been proposed. Most of the systems are based on a fundamental technique in the field of such encoding system, and some of the systems are based on an advanced complex technology combined with the foregoing fundamental technique. As of today, systems of MMR, JBIG, JPEG, MPEG and the like belonging to an International Standardized System correspond to such latter advanced system.
A brief description is given hereinafter as to the JBIG and JPEG. The JBIG regulates a system of hierarchical encoding of a binary image. Image data are "lossless" encoded, and a reproduced image becomes the same image as that of an original image. In this point, the JBIG is the same system as that of MH, MR or MMR utilized in a facsimile apparatus. An advantage of the JBIG system against a Facsimile system is that, in the Facsimile system, a compressive efficiency of a pseudo-expressed halftone image having the different statistic distribution is resulted in a bad efficiency because this system utilizes a run-length encoding based on run statistic, while in the JBIG system, the foregoing halftone image can be also compressed because this system utilizes an arithmetic encoding.
The JPEG system is a compression system of a multi-value (or multi-level) gradation image, and is a non-reversible encoding. This system can vary a compressive ratio depending on set parameters and the quality of a reproduced image is varied corresponding to such a variation. The JPEG system can not "lossless" encode data theoretically, however, it is possible to obtain the quality of a reproduced image of which deterioration can not be visually detected.
Next, the applicable field of the JBIG, JPEG and run-length encoding system will be briefly described. Since the oldest practical run-length encoding system is a reversible encoding system of binary data, any kind of digital data can be fundamentally dealt with. However, if it is considered to perform the most effective compression, the run-length encoding system is still fitted to the compression of binary image data utilized in a facsimile apparatus or the like. On the other hand, although some problems remain in the efficiency, it is possible to utilize the run-length encoding system for multi-value image data. As the practical use, for example, if only a CODEC for a facsimile apparatus is provided, such case as requiring to transfer multi-value gradation image data with lossless by utilizing the provided CODEC is considered. In this case, multi-value data is separated into bit planes and each of the separated data is encoded. If a multi-value image is separated into the bit plates, since a spatial correlation becomes weak except the most significant bit. Thus, when this method is utilized, generally, a conversion to a gradation expression utilizing a gray code is conducted. In this way, the multi-value data can be lossless encoded, however, even if the gray code is utilized as mentioned above, an entropy becomes extremely high level as to the lower bit, therefore, it becomes difficult to obtain a compressive efficiency.
The JBIG system, similarly to the run-length encoding, serving as the lossless encoding of the binary data can be utilized not only as an application of encoding of an image which is applicable to the run-length encoding but also adopts the hierarchical encoding, so that an excellent adaptation is held to, what is called, a soft-copying communication (communication of images between display terminals, and this communication is used to get access to the data base including images).
As described above, since the compression of the JBIG system does not depend on any statistic distribution of the binary data, any kind of source data can be compressed, and a compressive efficiency in the worst situation becomes 1. Therefore, even if data which does not include the large correlation/redundancy like an image is a source, an effect of the compression can be surely obtained. This fact means that the JPEG system can be reliably used even if a great deal of data exist because there is no any other effective reversible compression means.
The JPEG system has different idea from the foregoing two systems fundamentally in a point that this system is a non-reversible compressive system. Therefore, this system is limited to be used only when the non-reversible compressive system may be adopted. Since the JPEG system encodes data utilizing the redundancy of the multi-value gradation image as maximumly as possible, it is impossible to apply this system to the encoding of a binary image as it is.
As of today, under the situation that many facsimile apparatuses have been widely used, a technology for encoding the binary image becomes more important. An encoding system utilized, nowadays, in such field is the run-length encoding, and the encoding to be utilized in future in such field is the JBIG system.
Even if which of these systems is utilized, a large code compressive ratio with the almost same level can be obtained in encoding character images which have been most treated conventionally. In this case, a compressive ratio may be about one per several tens.
Recently, the case for transferring a pseudo gradation image becomes more frequently in accordance with the great improvement of the resolution of a reading apparatus (scanner) and a recording apparatus (printer). Originally, an image with low entropy depending on a dither method has been utilized. However, recently, the pseudo gradation image depending on random-dots generated by an ED (error diffusion) method or MD (mean difference minimization) method becomes to be widely used. If these random-dots having an extremely high-level entropy are run-length encoded, in the worst case, it cannot be denied that the code length becomes several times as long as that of an original image. If a random-dot image is encoded by the JBIG system, it is certainly possible to compress data as mentioned before. However, in this case, a compressive ratio does not exceed 2. Almost cases, the compressive ratio becomes 0.1 to 0.9. That is, the compressive ratio of an entire image is extremely reduced if only a small-sized pseudo gradation portion is included in an ordinary character image. This is because, the character data occupies almost part of an image is compressed to one per several tens, while the pseudo gradation image occupies only about 10% of an entire image is compressed only to about 0.6, so that, codes caused by the pseudo gradation image becomes more influential under the case of comparing with the code condition.
In the JBIG system, data of the pseudo gradation image can be compressed a little. However, contrary to this fact, when the run-length encoding system is utilized, data of the pseudo gradation image portion will be often increased inversely. Therefore, the pseudo gradation image data becomes more influential.